package cc.lucien.thread;

public class ThreadTest {
    public static void main(String[] args) {
        new MyThread().start();
        new Thread(new MyRunnable()).start();
        for (int i = 0; i < 30; i++) {
            System.out.println(Thread.currentThread().getName() + "Main-----------------");
        }
    }
}

class MyThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 30; i++) {
            System.out.println(Thread.currentThread().getName()+"MyThread++++++++++++++++");
        }
    }
}

class MyRunnable implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 30; i++) {
            System.out.println(Thread.currentThread().getName()+"MyRunnable***************");
        }
    }
}
